'use strict';

module.exports = app => {
  const { STRING, UUID, UUIDV4, INTEGER } = app.Sequelize;

  const model = app.model.define('contact', {
    id: {
      type: UUID,
      primaryKey: true,
      defaultValue: UUIDV4,
      comment: '主键',
    },
    name: {
      type: STRING,
      comment: '姓名',
    },
    sex: {
      type: STRING,
      comment: '性别',
    },
    dept: {
      type: STRING,
      comment: '部门',
    },
    position: {
      type: STRING,
      comment: '职位',
    },
    tel: {
      type: STRING,
      comment: '电话',
    },
    work_tel: {
      type: STRING,
      comment: '座机',
    },
    email: {
      type: STRING,
      comment: '邮箱',
    },
    qq: {
      type: STRING,
      comment: 'qq or msn',
    },
    customer_id: {
      type: UUID,
      comment: '客户Id',
    },
  }, {
    tableName: 'contact',
    comment: '联系人表',
  });

  return model;
};
